package com.jpa.web;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.jpa.pojo.Role;
import com.jpa.service.RoleService;

@RestController
public class RoleController extends BaseController {
	@Autowired
	RoleService roleService;

	@PreAuthorize("hasAuthority('/role/index')")
	@RequestMapping(value = "/role/index")
	public List<Role> roleList() {
		List<Role> list = roleService.findRoles("admin");
		return list;
	}

	@PreAuthorize("hasAuthority('/role/delete')")
	@RequestMapping(value = "/role/delete")
	public String delete() {

		return "delete role";
	}
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
} 